<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
    /* 全局样式 */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        position: relative;
    }

    body::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(5px);
    }

    /* 登录容器 */
    .login-container {
        width: 100%;
        max-width: 400px;
        padding: 40px;
        background: white;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 1;
    }

    /* 标题样式 */
    .login-title {
        color: #4CAF50;
        font-size: 28px;
        font-weight: 600;
        text-align: center;
        margin-bottom: 30px;
        position: relative;
        padding-bottom: 15px;
    }

    .login-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: #4CAF50;
        border-radius: 2px;
    }

    /* 错误提示样式 */
    .error-message {
        background: #fff5f5;
        color: #e53e3e;
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 20px;
        font-size: 14px;
        display: flex;
        align-items: center;
        text-align: center;
        border: 1px solid #fed7d7;
    }

    /* 表单样式 */
    .login-form {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .form-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .form-input {
        width: 100%;
        padding: 14px 18px;
        border: 2px solid #e8f5e9;
        border-radius: 12px;
        font-size: 15px;
        color: #2e7d32;
        transition: all 0.3s ease;
        background: #f8fdf9;
    }

    .form-input:focus {
        outline: none;
        border-color: #4CAF50;
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
        background: white;
    }

    .form-input::placeholder {
        color: #a5d6a7;
    }

    /* 登录按钮样式 */
    .login-button {
        width: 100%;
        padding: 14px;
        background: #4CAF50;
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-top: 10px;
    }

    .login-button:hover {
        background: #45a049;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
    }

    .login-button:active {
        transform: translateY(0);
    }

    /* 响应式调整 */
    @media (max-width: 480px) {
        .login-container {
            padding: 30px 20px;
            margin: 20px;
        }

        .login-title {
            font-size: 24px;
            margin-bottom: 25px;
        }

        .form-input {
            padding: 12px 16px;
            font-size: 14px;
        }

        .login-button {
            padding: 12px;
            font-size: 15px;
        }
    }
</style>
</head>
<body>
    <div class="login-container">
        <c:if test="${msg!=null}">
            <div class="error-message">${msg}</div>
        </c:if>

        <form class="login-form" action="login" method="post">
            <h2 class="login-title">登录后台</h2>
            
            <div class="form-group">
                <input type="text" 
                       class="form-input" 
                       placeholder="输入用户名" 
                       name="username" 
                       value="admin">
            </div>
            
            <div class="form-group">
                <input type="password" 
                       class="form-input" 
                       placeholder="输入密码" 
                       name="password" 
                       value="admin">
            </div>
            
            <button class="login-button" type="submit">登录</button>
        </form>
    </div>
</body>
</html>
